<template>
	<view>
		<div class="wrap"></div>
		<uni-nav-bar height="44px" shadow :title="title" :left-icon="barIcon" @clickLeft="clickLeft" :rightText="rightText"
			@clickRight="clickRight" :right-Width="rightWidth">
		</uni-nav-bar>
	</view>
</template>

<script>
	export default {
		name: "myNavBar",
		props: {
			title: {
				type: String,
				default: "默认"
			},
			rightText: {
				type: String,
				default: ""
			},
			rightWidth: {
				type: String,
				default: "120rpx"
			},
			barIcon: {
				type: String,
				default: ""
			}
		},
		data() {
			return {};
		},
		methods: {
			// 返回上一个页面
			clickLeft() {
				if (!this.barIcon) return
				uni.navigateBack({
					delta: 1
				});
			},
			clickRight() {
				this.$emit('clickRight')
			}
		}
	};
</script>

<style lang="scss" scoped>
	.wrap {
		height: var(--status-bar-height);
		width: 100%;
	}

	::v-deep .uni-nav-bar-right-text {
		font-size: 25rpx;
	}
</style>